package com.hundsun.cprs.yyt.service.report.service.impl;

import com.hundsun.cprs.yyt.common.base.BaseService;
import com.hundsun.cprs.yyt.service.report.dao.DaliyClinchSumDao;
import com.hundsun.cprs.yyt.service.report.domain.DaliyClinchSum;
import com.hundsun.cprs.yyt.service.report.domain.query.DaliyClinchSumQuery;
import com.hundsun.cprs.yyt.service.report.service.DaliyClinchSumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class DaliyClinchSumServiceImpl extends BaseService implements DaliyClinchSumService {

    @Autowired
    private DaliyClinchSumDao daliyClinchSumDao;

    @Override
    public void add(DaliyClinchSum daliyClinchSum) {
        daliyClinchSumDao.insert(daliyClinchSum);
    }

    @Override
    public void queryByPage(DaliyClinchSumQuery query) {
        List<DaliyClinchSum> daliyClinchSumList = daliyClinchSumDao.queryByPage(query);
        query.compatible(daliyClinchSumList);
    }

    @Override
    public List<DaliyClinchSum> getRecentRecord(String areaCode, int time) {
        return daliyClinchSumDao.getRecentRecord(areaCode,time);
    }

    @Override
    public DaliyClinchSum getDaliyClinchSumFromArea(String areaCode, Date startTime, Date endTime) {
        return daliyClinchSumDao.getDaliyClinchSumFromArea(areaCode,startTime,endTime);
    }
}
